package com.trkj.vo;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * 权限资源VO
 * @author 吴山峰
 *
 */
public class PermissionsVo implements Comparable<PermissionsVo>{
	@JSONField(name = "id")
	private Integer perid;
	@JSONField(name = "text")
	private String pername;
    @JSONField(name = "checked")
    private boolean selected;
    
	public Integer getPerid() {
		return perid;
	}

	public void setPerid(Integer perid) {
		this.perid = perid;
	}

	public String getPername() {
		return pername;
	}
	
	public void setPername(String pername) {
		this.pername = pername;
	}

	public boolean isSelected() {
		return selected;
	}

	public void setSelected(boolean selected) {
		this.selected = selected;
	}

	public PermissionsVo(Integer perid, String pername, boolean selected) {
		super();
		this.perid = perid;
		this.pername = pername;
		this.selected = selected;
	}
	
	public PermissionsVo() {
		super();
	}
	
	 	@Override
	    public int hashCode() {
	        final int prime = 31;
	        int result = 1;
	        result = prime * result + ((perid == null) ? 0 : perid.hashCode());
	        return result;
	    }

	    @Override
	    public boolean equals(Object obj) {
	        if (this == obj)
	            return true;
	        if (obj == null)
	            return false;
	        if (getClass() != obj.getClass())
	            return false;
	        PermissionsVo other = (PermissionsVo) obj;
	        if (perid == null) {
	            if (other.perid != null)
	                return false;
	        } else if (!perid.equals(other.perid))
	            return false;
	        return true;
	    }

	    @Override
	    public int compareTo(PermissionsVo o) {
	        return (int) (this.getPerid() - o.getPerid());
	    }
	
}
